package cc.vicp.djx314.starfood.service.account.impls;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cc.vicp.djx314.starfood.dao.account.AccountMapper;
import cc.vicp.djx314.starfood.service.account.AccountService;

@Service
public class AccountServiceImpl implements AccountService {
	@Autowired
	AccountMapper accountMapper;

	@Override
	@Transactional(readOnly = true)
	public boolean isAccountNameExists(String name) {
		boolean isAccountNameExists = true;
		Integer id = accountMapper.isAccountNameExists(name);
		if (id == null) {
			isAccountNameExists = false;
		}
		return isAccountNameExists;
	}
}